package com.xt.base.model.base;

import com.xt.base.dao.hibernate.code.IAutoCreateCode;
import com.xt.base.pojo.BasePOJO;

/**
 * 地址 <br>
 * 
 * <p>
 * <a href="Address.java.html"><i>查看源文件</i></a>
 * </p>
 * 
 * @author 杨洪波
 * @version $Revision: $<br>
 *          $Id: $
 * @hibernate.class table="Address" batch-size="200" dynamic-update="true"
 *                  dynamic-insert="true"
 *
 */
public class Address extends BasePOJO implements IAutoCreateCode {

	private static final long serialVersionUID = 3057280694793501581L;

	/** 所属行政区划 */
	private String canton;
	
	/**地址(乡、镇、街道办)*/
	private String streetOrTown;

	/** 详细地址 */
	private String detail;

	/** 邮政编码 */
	private String postalCode;

	public Address() {
	}

	public Address(String canton, String detail, String postalCode) {
		this.canton = canton;
		this.detail = detail;
		this.postalCode = postalCode;
	}

	private static String[] justProperties = new String[] { "code", "clazz","streetOrTown",
			"detail", "postalCode", "canton.code", "canton.clazz","canton.wholeName"};

	public String[] getJustProperties() {
		return justProperties;
	}
	
	public boolean isEmpty(){
		boolean nothing = canton == null 
				&& isEmpty(detail) && isEmpty(postalCode) 
				&& isEmpty(streetOrTown);
		return nothing?isEmpty(getCode()):false; 
	}

	/**
	 * @hibernate.property column = "Canton"
	 *                        
	 * @return 所属行政区划
	 */
	public String getCanton() {
		return canton;
	}

	public void setCanton(String canton) {
		this.canton = canton;
	}

	/**
	 * @hibernate.property column="Detail" 
	 * @return 详细地址
	 */
	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

	/**
	 * @hibernate.property column="PostalCode"
	 * @return 邮政编码
	 */
	public String getPostalCode() {
		return postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	/**
	 * @hibernate.property column="StreetOrTown"
	 * @return 详细地址(乡、镇、街道办)
	 */
	public String getStreetOrTown() {
		return streetOrTown;
	}

	public void setStreetOrTown(String streetOrTown) {
		this.streetOrTown = streetOrTown;
	}

}
